home *** CD-ROM | disk | FTP | other *** search
- public class TEU4_Main_Demo extends Codex {
- private Demo2Chronicle chronScript = (Demo2Chronicle)((Codex)this).GetChronicleScript(0);
- private CodexRegion _KnightRegion;
- private CodexActor _Knight1;
- private CodexActor _Knight2;
- private CodexActor _Orsi;
- private CodexActor _Corpse;
- private CodexThing _Switch;
- private CodexActor _serena;
- private CodexActor _christof;
- private CodexActor _wilhem;
- private CodexActor _erik;
- private int christofGUID;
- private int erikGUID;
- private int orsiGUID;
- private int serenaGUID;
- private int wilhemGUID;
- private float[] pos;
- private float[] corpsePos;
- public int bOrsiPos;
- public boolean bOrsiConversation;
- public boolean bSerenaCorpseConversation;
- public boolean bTeutonicConversation;
- public boolean bFreedomConversation;
- private static final int TIMER_ID_SERENACORPSE = 1;
- private static final int TIMER_ID_CORPSEGETUP = 2;
- private static final int TIMER_ID_CORPSEWALK = 3;
- private static final int TIMER_ID_CORPSESWITCH = 4;
- private static final int TIMER_ID_DOOROPEN = 5;
- private static final int TIMER_ID_CORPSECOLAPSE = 6;
- private static final int TIMER_ID_FREEDOMCONV = 7;
- private static final int TIMER_ID_FADEOUT = 8;
- private static final int TIMER_ID_FADEIN = 9;
- public static String[] _params = new String[]{"Teutonic Knight region", "Teutonic Knight 1", "Teutonic Knight 2", "Orsi", "Corpse", "Switch"};
-
- public void SerenaCorpseConversation(int starterGuid, int npcGuid) {
- CodexSound.PushMusic("DA_Conversation_1.mp3", 50);
- this.bSerenaCorpseConversation = true;
- ((Codex)this).AIOff();
- CodexPlayer.TeleportPartyToConversation(CodexPlayer.GetCurrentPlayer(), 1);
- ((Codex)this).ExecuteConversation(starterGuid, npcGuid, "Demo_SerenaCorpse", "Demo_SerenaCorpse.nco", 4);
- }
-
- public void textended(int readerGuid) {
- this._Corpse.PlayActorMotionSetMode(141, false, 30.0F);
- this.OrsiConversation(readerGuid, 0);
- }
-
- public void convended(int starterGuid, boolean bAborted, int returnValue) {
- if (this.bOrsiConversation) {
- CodexSound.PopMusic();
- ((Codex)this).AIOn();
- this.bOrsiConversation = false;
- new CodexQuest(CodexQuest.Load("V1_EscapeKnightBase"));
- this.OrsiLeaves();
- }
-
- if (this.bSerenaCorpseConversation) {
- ((Codex)this).AIOn();
- this.bSerenaCorpseConversation = false;
- ((Codex)this).SetTimer(1.0F, 2);
- }
-
- if (this.bFreedomConversation) {
- CodexSound.PopMusic();
- ((Codex)this).AIOn();
- this.bFreedomConversation = false;
- CodexCamera.Release(starterGuid);
- }
-
- if (this.bTeutonicConversation) {
- ((Codex)this).AIOn();
- this.bTeutonicConversation = false;
- CodexCamera.Release(starterGuid);
- }
-
- }
-
- public void beginscene(int clientGuid, int captureID) {
- this._Corpse.SetActorFlags(4);
- if (!CodexSequence.GetChronicleFlag(50)) {
- CodexSequence.SetChronicleFlag(50);
- this.christofGUID = CodexThing.GuidFromCastID("Christof");
- this.erikGUID = CodexThing.GuidFromCastID("Erik");
- this.serenaGUID = CodexThing.GuidFromCastID("Serena");
- this.wilhemGUID = CodexThing.GuidFromCastID("Wilhem");
- this.orsiGUID = CodexThing.GuidFromCastID("Orsi");
- CodexPlayer Wilhem = new CodexPlayer(this.wilhemGUID);
- CodexPlayer Erik = new CodexPlayer(this.erikGUID);
- CodexPlayer Serena = new CodexPlayer(this.serenaGUID);
- CodexPlayer Christof = new CodexPlayer(CodexThing.GuidFromCastID("Christof"));
- ((CodexThing)Christof).SetFoley("playerChristof.nag");
- Wilhem.AddToParty();
- Serena.AddToParty();
- Erik.AddToParty();
- CodexPlayer.TeleportPartyToConversation(CodexPlayer.GetCurrentPlayer(), 0);
- this._serena = new CodexActor(this.serenaGUID);
- this._christof = new CodexActor(this.christofGUID);
- this._wilhem = new CodexActor(this.wilhemGUID);
- this._erik = new CodexActor(this.erikGUID);
- CodexCamera.AddFade(CodexPlayer.GetCurrentPlayer(), 0.0F, 255.0F, 1.0F, false);
- ((Codex)this).ExecuteText(clientGuid, super.guid, "IntroTextDemo2");
- }
-
- }
-
- public void arrived(int thingGuid, int frameNum, int captureId) {
- if (thingGuid == this._Orsi.GetGUID()) {
- if (this.bOrsiPos < this._Orsi.GetNumFrames() - 1) {
- ++this.bOrsiPos;
- this.pos = this._Orsi.GetFramePosition(this.bOrsiPos);
- this._Orsi.SendActorToPos(this.pos, 90.0F);
- }
- } else if (thingGuid == this._Corpse.GetGUID()) {
- this._Corpse.LookAtThing(this._Switch.GetGUID());
- int duration = this._Corpse.PlayActorMotionSetMode(89, false, 30.0F);
- ((Codex)this).SetTimer((float)duration / 1800.0F, 4);
- }
-
- }
-
- public void FreedomConversation(int starterGuid, int npcGuid) {
- this.bFreedomConversation = true;
- ((Codex)this).AIOff();
- CodexPlayer.TeleportPartyToConversation(CodexPlayer.GetCurrentPlayer(), 1);
- ((Codex)this).ExecuteConversation(starterGuid, npcGuid, "Demo_Freedom", "Demo_Freedom.nco", 4);
- }
-
- public void TeutonicConversation(int starterGuid, int npcGuid) {
- this.bTeutonicConversation = true;
- ((Codex)this).AIOff();
- CodexPlayer.TeleportPartyToConversation(CodexPlayer.GetCurrentPlayer(), 2);
- ((Codex)this).ExecuteConversation(starterGuid, npcGuid, "Demo_Teutonic", "Demo_Teutonic.nco", 4);
- }
-
- public void entered(int guid, int causeGUID, int captureID) {
- if (Codex.IsPlayerGuid(causeGUID)) {
- if (guid == this._KnightRegion.GetGUID() && !CodexSequence.GetChronicleFlag(51)) {
- CodexSequence.SetChronicleFlag(51);
- this.TeutonicConversation(causeGUID, 0);
- }
-
- }
- }
-
- public void convreached(int starterGuid, int curEvent, int curLine, int lineDuration, int speakerGuid) {
- if (this.bOrsiConversation) {
- switch (curEvent) {
- case 0:
- switch (curLine) {
- case 0:
- CodexCamera.SetupCutscene(starterGuid, this.christofGUID, this.orsiGUID);
- CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
- break;
- case 1:
- CodexCamera.SetShot(starterGuid, 1, 2, 2, 0, 0.0F);
- break;
- case 2:
- CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
- break;
- case 3:
- CodexCamera.SetShot(starterGuid, 1, 2, 2, 0, 0.0F);
- break;
- case 4:
- CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
- break;
- case 5:
- CodexCamera.SetShot(starterGuid, 1, 2, 2, 0, 0.0F);
- break;
- case 6:
- CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
- break;
- case 7:
- CodexCamera.SetShot(starterGuid, 7, 2, 2, 0, 0.0F);
- }
- }
- }
-
- if (this.bSerenaCorpseConversation) {
- switch (curEvent) {
- case 0:
- switch (curLine) {
- case 0:
- CodexCamera.SetupCutscene(starterGuid, this.wilhemGUID, this.erikGUID);
- CodexCamera.SetShot(starterGuid, 7, 2, 2, 0, 0.0F);
- break;
- case 1:
- CodexCamera.SetShot(starterGuid, 3, 2, 2, 0, 0.0F);
- break;
- case 2:
- CodexCamera.SetShot(starterGuid, 7, 2, 2, 0, 0.0F);
- break;
- case 3:
- CodexCamera.SetupCutscene(starterGuid, this.christofGUID, this.serenaGUID);
- CodexCamera.SetShot(starterGuid, 1, 2, 2, 0, 0.0F);
- this._christof.LookAtThing(this.serenaGUID);
- break;
- case 4:
- CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
- break;
- case 5:
- CodexCamera.PlayPath(CodexPlayer.GetCurrentPlayer(), ((Codex)this).GetGUID(), "SerenaCast.ncp", 30.0F);
- this._serena.LookAtThing(this._Corpse.GetGUID());
- this._christof.LookAtThing(this._Corpse.GetGUID());
- this._wilhem.LookAtThing(this._Corpse.GetGUID());
- this._erik.LookAtThing(this._Corpse.GetGUID());
- this._serena.PlayActorMotionSetMode(147, false, 30.0F);
- }
- }
- }
-
- if (this.bFreedomConversation) {
- switch (curEvent) {
- case 0:
- switch (curLine) {
- case 0:
- CodexCamera.SetupCutscene(starterGuid, this.wilhemGUID, this.erikGUID);
- CodexCamera.SetShot(starterGuid, 7, 2, 2, 0, 0.0F);
- break;
- case 1:
- CodexCamera.SetShot(starterGuid, 3, 2, 2, 0, 0.0F);
- break;
- case 2:
- CodexCamera.SetShot(starterGuid, 7, 2, 2, 0, 0.0F);
- }
- }
- }
-
- if (this.bTeutonicConversation) {
- switch (curEvent) {
- case 0:
- switch (curLine) {
- case 0:
- CodexCamera.SetupCutscene(starterGuid, speakerGuid, 0);
- CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
- break;
- case 1:
- CodexCamera.SetupCutscene(starterGuid, speakerGuid, 0);
- CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
- break;
- case 2:
- CodexCamera.SetupCutscene(starterGuid, speakerGuid, 0);
- CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
- }
- }
- }
-
- }
-
- public TEU4_Main_Demo(CodexRegion KnightRegion, CodexActor Knight1, CodexActor Knight2, CodexActor Orsi, CodexActor Corpse, CodexThing Switch) {
- this._KnightRegion = new CodexRegion(((Codex)KnightRegion).GetGUID());
- this._Knight1 = new CodexActor(((Codex)Knight1).GetGUID());
- this._Knight2 = new CodexActor(((Codex)Knight2).GetGUID());
- this._Orsi = new CodexActor(((Codex)Orsi).GetGUID());
- this._Corpse = new CodexActor(((Codex)Corpse).GetGUID());
- this._Switch = new CodexThing(((Codex)Switch).GetGUID());
- ((Codex)this).CaptureThing(this._KnightRegion.GetGUID());
- ((Codex)this).CaptureThing(this._Knight1.GetGUID());
- ((Codex)this).CaptureThing(this._Knight2.GetGUID());
- ((Codex)this).CaptureThing(this._Orsi.GetGUID());
- ((Codex)this).CaptureThing(this._Corpse.GetGUID());
- this.pos = new float[3];
- this.corpsePos = new float[3];
- }
-
- public void timer(int timerID, float arg0, float arg1, float arg2, float arg3) {
- switch (timerID) {
- case 1:
- this._Orsi.Remove();
- this.SerenaCorpseConversation(CodexPlayer.GetCurrentPlayer(), 0);
- break;
- case 2:
- ((Codex)this).BeginCutscene(CodexPlayer.GetCurrentPlayer(), 0);
- float[] offset = new float[3];
- offset[0] = 0.0F;
- offset[1] = 0.0F;
- offset[2] = 0.0F;
- int effectGuid = this._Corpse.SpawnThing("neckBlood");
- this._Corpse.AttachThing(effectGuid, 17, offset, 1);
- int duration = this._Corpse.PlayActorMotionSetMode(140, false, 30.0F);
- ((Codex)this).SetTimer((float)duration / 1000.0F, 3);
- break;
- case 3:
- CodexCamera.PlayPath(CodexPlayer.GetCurrentPlayer(), ((Codex)this).GetGUID(), "CorpseWalk.ncp", 30.0F);
- this.corpsePos = this._Corpse.GetFramePosition(1);
- this._Corpse.StopActorAction();
- this._Corpse.SendActorToPos(this.corpsePos, 30.0F);
- break;
- case 4:
- this._Corpse.ActorActionActivate(this._Switch.GetGUID(), 0);
- ((Codex)this).SetTimer(1.0F, 5);
- break;
- case 5:
- CodexCamera.PlayPath(CodexPlayer.GetCurrentPlayer(), ((Codex)this).GetGUID(), "DoorOpen.ncp", 30.0F);
- ((Codex)this).SetTimer(3.0F, 6);
- break;
- case 6:
- CodexCamera.PlayPath(CodexPlayer.GetCurrentPlayer(), ((Codex)this).GetGUID(), "CorpseWalk.ncp", 30.0F);
- int duration = this._Corpse.PlayActorMotionSetMode(122, false, 20.0F);
- ((Codex)this).SetTimer((float)duration / 1000.0F, 7);
- break;
- case 7:
- this._Corpse.SetActorFlags(268435456);
- this.FreedomConversation(CodexPlayer.GetCurrentPlayer(), 0);
- break;
- case 8:
- ((Codex)this).SetTimer(2.0F, 1);
- CodexCamera.AddFade(CodexPlayer.GetCurrentPlayer(), 255.0F, 0.0F, 4.0F, true);
- }
-
- }
-
- public void OrsiLeaves() {
- ((Codex)this).SetTimer(1.0F, 8);
- this.pos = this._Orsi.GetFramePosition(1);
- this.bOrsiPos = 1;
- this._Orsi.SendActorToPos(this.pos, 90.0F);
- }
-
- public void OrsiConversation(int starterGuid, int npcGuid) {
- CodexSound.PushMusic("DA_Conversation_2.mp3", 50);
- this.bOrsiConversation = true;
- ((Codex)this).AIOff();
- CodexPlayer.TeleportPartyToConversation(CodexPlayer.GetCurrentPlayer(), 0);
- ((Codex)this).ExecuteConversation(starterGuid, npcGuid, "Demo_Orsi", "Demo_Orsi.nco", 4);
- }
- }
-